﻿using System;
using System.Collections.Generic;
using BHS.TFSChangsetAnalyser.Model;
using BHS.TFSChangsetAnalyser.ViewModel;
using NLog;

namespace BHS.TFSChangsetAnalyser.Import
{
    /// <summary>
    /// Provider of changeset information to be used for testing the application, disconnected from a TFS Server.
    /// </summary>
    public class TestChangesetProvider : IChangesetInformationProvider
    {
        private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

        public IMainWindowViewModel ViewModel { private get; set; }

        public IEnumerable<ChangesetInfo> GetChangesets()
        {
            Logger.Info("Start GetChangesets");

            List<ChangesetInfo> changesets = new List<ChangesetInfo>();

            ChangesetInfo changesetInfo1 = new ChangesetInfo
                                               {
                                                   ChangesetId = 1,
                                                   NumberOfChanges = 10,
                                                   NumberOfReviewableChanges = 8,
                                                   Comment = "Initial checkin",
                                                   SubmittedDate = DateTime.Now,
                                                   Submitter = "Bryan"
                                               };
            changesets.Add(changesetInfo1);

            ChangesetInfo changesetInfo2 = new ChangesetInfo
                                           {
                                               ChangesetId = 2,
                                               NumberOfChanges = 5,
                                               NumberOfReviewableChanges = 5,
                                               Comment = "Final checkin",
                                               SubmittedDate = DateTime.Now,
                                               Submitter = "Bryan",
                                               CodeReviewer = "Fred"
                                           };
            changesets.Add(changesetInfo2);

            Logger.Info("End GetChangesets");

            return changesets;
        }
    }
}
